provider Discover POST /api/0/organizations/{organization_id_or_slug}/discover/saved/
@utdk/sentry /api/0/organizations/{organization_id_or_slug}/discover/saved/
Create a New Saved Query
Create a new saved query for the given organization.
organization_id_or_slug path required
The ID or slug of the organization the resource belongs to.
string

Try it

Authentication
Configure credentials for API Reference
Gateway
The gateway proxies requests and injects credentials server-side. Configure credentials above, then enter your gateway URL.

Saved automatically to browser storage.

createANewSavedQuery
POST/api/0/organizations/{organization_id_or_slug}/discover/saved/
Create a new saved query for the given organization.

Parameters

required

The ID or slug of the organization the resource belongs to.

Input

required

The user-defined saved query name.

The saved projects filter for this query.

The dataset you would like to query. Note: `discover` is a **deprecated** value. The allowed values are: `error-events`, `transaction-like` * `discover` * `error-events` * `transaction-like`

The saved start time for this saved query.

The saved end time for this saved query.

The saved time range period for this saved query.

The fields, functions, or equations that can be requested for the query. At most 20 fields can be selected per request. Each field can be one of the following types: - A built-in key field. See possible fields in the [properties table](/product/sentry-basics/search/searchable-properties/#properties-table), under any field that is an event property. - example: `field=transaction` - A tag. Tags should use the `tag[]` formatting to avoid ambiguity with any fields - example: `field=tag[isEnterprise]` - A function which will be in the format of `function_name(parameters,...)`. See possible functions in the [query builder documentation](/product/discover-queries/query-builder/#stacking-functions). - when a function is included, Discover will group by any tags or fields - example: `field=count_if(transaction.duration,greater,300)` - An equation when prefixed with `equation|`. Read more about [equations here](/product/discover-queries/query-builder/query-equations/). - example: `field=equation|count_if(transaction.duration,greater,300) / count() * 100`

How to order the query results. Must be something in the `field` list, excluding equations.

The name of environments to filter by.

Filters results by using [query syntax](/product/sentry-basics/search/).

Aggregate functions to be plotted on the chart.

Visualization type for saved query chart. Allowed values are: - default - previous - top5 - daily - dailytop5 - bar

Number of top events' timeseries to be visualized.

Resolution of the time series.

Enter a gateway URL above to enable sending.

Code snippet
Updates live as you fill in the form above.

TypeScript

import sentry from '@utdk/sentry';

await sentry.createANewSavedQuery({
  "queryDataset": "error-events"
})